-- vim:fileencoding=utf-8:foldmethod=marker:foldmarker={{{,}}}

-- {{{ imports and defines

require "nvchad.options"

local o = vim.o
local g = vim.g
local opt = vim.opt
local cmd = vim.cmd

-- }}}

-- {{{

-- }}}

-- {{{ Diagnostic signs

local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
	local hl = "DiagnosticSign" .. type
	vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end

-- }}}

-- {{{ relative line number and folds

opt.relativenumber = true
-- deprecated
--opt.foldmethod = "expr"
--opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"

--opt.foldexpr = vim.treesitter.foldexpr()

-- }}}

-- {{{ Scrolloff and tabs

-- " For example - scrolloff=7
-- " When cursor on 7 line, counting from bottom, and U going to next line,
-- " document will scroll
-- " Default value = 0
opt.scrolloff = 5

-- " Copying indents from prev line when adding new
opt.autoindent = true

-- " price of tab (in spaces)
opt.tabstop = 3

-- " By default - adjusting the indentation width (in spaces) adding by commands
-- " >> and <<. If != tabstop, then indent can consist both of spaces and tabs.
-- " When smarttab is on, may have an additional impact
-- " (0 for ‘tabstop’):
opt.shiftwidth = 3

-- " Pressing tab in BoL (before 1-st not-space symbol) adding indent == shiftwidth
-- " Backspace deleting entire indent, not just one tab
opt.smarttab = true

-- " Count of spaces the tab is displayed with when added
-- " For example - tabstop=8 ; softtabstop=4
-- " Example - Triple tab. We have - 1 tab (8 spaces) and 4 spaces
-- " (0 for ‘tabstop’, -1 for ‘shiftwidth’):
opt.softtabstop = -1

-- " Is need change tabs by spaces
-- If == false - breaks new line indents in python files
opt.expandtab = false

-- " Show tabs as chars
--opt.list = true
--opt.listchars="tab: "

-- for no changing my tabs to fucking spaces by PEP8
-- in /usr/share/nvim/runtime/ftplugin/python.vim line 119
g.python_recommended_style = 0

-- }}}

-- {{{ Cursor line and clipboard

-- to enable cursorline!
o.cursorlineopt = "both"

o.clipboard = "unnamedplus"

-- }}}

-- {{{

-- if "a" - mouse enabled. if "" - mouse disabled
opt.mouse = ""

-- }}}

-- {{{ If you installed python packages in virtual env - uncomment this line

--g.python3_host_prog = vim.fn.expand("$HOME") .. "/.local/venv/nvim/bin/python"

-- }}}
